<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="<s:property value="#application.website.keywords"/>" />
<meta name="description" content="<s:property value="#application.website.description"/>" />
<title>商家-<s:property value="#application.website.websiteName"/></title>
<link href="css/css.css"  type="text/css" rel="stylesheet"/>
<script type="text/javascript" src="js/tools/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/tools/jqueryurl.js"></script>
<script type="text/javascript" src="admin/js/public.js"></script>
<script>
var user='yes';
$(function(){
categoryList("categoryId",2,-1);
});
function search()
{
   var categoryId=$("#categoryId").val();
   var subCategoryId=$("#subCategoryId").val();
   var searchStr=$.trim($("#seatchStr").val());
   
     window.location.href='business.action?page=1&searchStr='+categoryId+"_"+subCategoryId+"_"+encodeURI(encodeURI(searchStr));
   
}
</script>
</head>
<body>
 <div id="container">
   <div id="Header">
     <jsp:include page="../header.jsp"></jsp:include>
   </div>
   <div id="PageBody">
     <div class="mina">
       <div class="subleft">
         <div class="subnav">
           <img src="images/zy_27.gif" />
           <ul>
             <s:iterator value="categoryList" id="id">
                   <li><a href="business.action?page=1&searchStr=<s:property value="#id[0].id"/>_-2_"><s:property value="#id[0].name"/></a></li>
                    <s:if test="%{#id[1].size!=0}">
                       <s:set name="str" ><s:property value="#id[0].id"/></s:set>
                       <s:if test="%{#parameters.searchStr[0].split('_')[0]==#str}">
                         <div class="navclass" style="display:block;">
                       </s:if>
                       <s:else>
                          <div class="navclass">
                       </s:else>
	                    <s:iterator value="#id[1]">
	                        -<a href="business.action?page=1&searchStr=<s:property value="pid"/>_<s:property value="id"/>_" hasbox="2">&nbsp;<s:property value="name"/></a> <br />
	                    </s:iterator>
			            </div>
                    </s:if>
             </s:iterator>
           </ul>
           <div class="navbott">资合信-易通卡</div>
         </div>
         <div class="search">
           <div><p>商户类别&nbsp;&nbsp;
           <select id="categoryId" style="width:120px;" onchange="categoryList('subCategoryId',2,$(this).val());"></select></p>
           <p>商户区域&nbsp;&nbsp;
             <select id="subCategoryId" style="width:120px;"><option value="-2">请选择类别</option></select></p>
           <p>
             <input type="image" onclick="search()" name="imageField" id="imageField" src="images/zy_28.gif" style="border:0px; float:right; margin-right:12px; height:22px" /><input id="seatchStr" type="text"style="width:115px;" />
           </p>
           </div>
         </div>
         
          <jsp:include page="../context.jsp"></jsp:include>
         
       </div>
       <div class="subright">
         <div class="subright01">
           <div class="subtitle"><s:property value="path" escape="false"/>
           </div>
           <div class="subright02">
             <div class="activitybox">
             <s:iterator value="list" id="id">
                    <div class="showbox">
		               <div class="imgbox"><a  href="business!businessDetial.action?business.id=<s:property value="#id[0].id"/>" target="_blank"><img src="<s:property value="#id[0].image"/>" /></a></div>
		               <div class="boxcont">
		               <p><span><s:property value="#id[0].discount"/>
		</span><a  href="business!businessDetial.action?business.id=<s:property value="#id[0].id"/>" target="_blank"><s:property value="#id[0].name"/></a><br />
		                 </p>
		               <strong>类别：<s:property value="#id[1].name"/>&nbsp;&nbsp;<s:property value="#id[2].name"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;地址：<s:property value="#id[0].address"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;电话：<s:property value="#id[0].tel"/></strong><br />
		               <s:property value="@com.linkcard.commen.tools.Helper@deleteHtml(#id[0].introduction,90,'...')"/></div>
		             </div>
             </s:iterator>
             </div>
             <div class="page">
             <s:if test="#request.list.size()!=0">
				 <s:if test="%{searchStr!=null}">
				   <s:set name="pageUrl" >business.action?searchStr=${ searchStr}&page=</s:set>
				  </s:if>
			     <s:else>
			      <s:set name="pageUrl" >business.action?page=</s:set>
			     </s:else>
			   
		      <a href="${pageUrl}1">第一页</a>
		      <a href="${pageUrl}<s:property value="#request.pageObj.prePage"/>">&lt; 上一页 </a>
		      <s:set name="totalPage" value="#request.pageObj.totalPage"></s:set>
		      <s:set name="currentPage" value="#request.pageObj.currentPage"></s:set>
							   <s:if test="#currentPage<=0">
							      <s:set name="currentPage" value="1"></s:set>
							   </s:if>
							   <s:elseif test="#currentPage>#totalPage">
							      <s:set name="currentPage" value="#totalPage"></s:set>
							   </s:elseif>
							   
							   <s:if test="#totalPage%6>0">
							       <s:set name="pageSize" value="#totalPage/6+1"></s:set>
							   </s:if>
							   <s:else>
							       <s:set name="pageSize" value="#totalPage/6"></s:set>
							   </s:else>
							   <s:if test="#currentPage%6>0">
							       <s:set name="cPageSize" value="#currentPage/6+1"></s:set>
							   </s:if>
							   <s:else>
							       <s:set name="cPageSize" value="#currentPage/6"></s:set>
							   </s:else>
							   <s:set name="first" value="6*(#cPageSize-1)"></s:set>
							   <s:if test="#first==0">
							      <s:set name="first" value="1"></s:set>
							   </s:if>
							   <s:set name="last" value="#cPageSize*6"></s:set>
							   <s:if test="#last>#totalPage">
							      <s:set name="last" value="#totalPage"></s:set>
							   </s:if>
				
							     <s:bean name="org.apache.struts2.util.Counter" id="counter"> 
							       <s:param name="first" value="#first"/>
							       <s:param name="last" value="#last" />
							       <s:iterator status="status"> 
							         <s:if test="#currentPage==(#status.index+#first)">
							            <s:a href="%{pageUrl}%{#status.index+#first}" cssClass="on" ><s:property value="#status.index+#first" /></s:a>
							         </s:if>
							         <s:else>
							           <s:a href="%{pageUrl}%{#status.index+#first}" ><s:property value="#status.index+#first" /></s:a>
							         </s:else>
							       </s:iterator> 
							     </s:bean>
							     <s:if test="#last<#totalPage">
							       ......&nbsp;
							     </s:if>
		      <a href="${pageUrl}<s:property value="#request.pageObj.nextPage"/>">下一页 ></a>
		      <a href="${pageUrl}<s:property value="#request.pageObj.totalPage"/>">最后一页</a>
		   </s:if> 
             
             </div>
           </div>
         </div>
       </div>
     </div>
   </div>
   <div id="Footer">
    <jsp:include page="../bottom.jsp"></jsp:include>
   </div>
 </div>
</body>
</html>

